package com.crusinnovation.unitTest.comparator;
import static org.junit.Assert.assertEquals;
import java.util.Comparator;

import com.cyrusinnovation.test.record.PersonRecord;

public class RecordComparatorTestRunner {

	Comparator<PersonRecord> comparator;
	
	public RecordComparatorTestRunner() {
		super();
	}
	
	public void setComparator(Comparator<PersonRecord> comparator) {
		this.comparator=comparator;
	}

	protected void runCompareToTest(PersonRecord less, PersonRecord more, String message) {
		int value=comparator.compare(less, more);
		assertEquals(message, -1, value);
		value=comparator.compare(more, less);
		assertEquals(message, 1, value);
		value=comparator.compare(less, less);
		assertEquals(message, 0, value);		
	}
}